package UserInterface;

import javax.swing.JPanel;

import java.awt.Color;

import javax.swing.JLabel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;

import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;

public class GetMoneyChooseSum extends JPanel {
	JButton btnSum10;
	JButton btnSum50;
	JButton btnSum100;
	JButton btnSum200;
	JButton btnBack;
	JButton btnAnotherAmount;
	JButton buttonCancel;
	
	public void addAnotherAmountList(ActionListener list){
		btnAnotherAmount.addActionListener(list);
	}
	
	public void addCancelListener(ActionListener list){
		buttonCancel.addActionListener(list);
	}
	public void addBackListener(ActionListener list){
		btnBack.addActionListener(list);
	}
	public void addSum10ActionListener(ActionListener list){
		btnSum10.addActionListener(list);
	}
	public void addSum50ActionListener(ActionListener list){
		btnSum50.addActionListener(list);
	}
	public void addSum100ActionListener(ActionListener list){
		btnSum100.addActionListener(list);
	}
	public void addSum200ActionListener(ActionListener list){
		btnSum200.addActionListener(list);
	}

	/**
	 * Create the panel.
	 */
	public GetMoneyChooseSum() {
		setBackground(new Color(255, 248, 220));
		this.setSize(500, 500);
		
		JLabel lblSelect = new JLabel("Select amount of money:");
		lblSelect.setForeground(new Color(128, 0, 0));
		lblSelect.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 20));
		
		 btnSum10 = new JButton("10");
		btnSum10.setFont(new Font("Tahoma", Font.BOLD, 16));
		
	    btnSum50 = new JButton("50");
		btnSum50.setFont(new Font("Tahoma", Font.BOLD, 16));
		
	    btnSum100 = new JButton("100");
		btnSum100.setFont(new Font("Tahoma", Font.BOLD, 16));
		
		btnSum200 = new JButton("200");
		btnSum200.setFont(new Font("Tahoma", Font.BOLD, 16));
		
	    btnBack = new JButton("<<Back");
		btnBack.setFont(new Font("Tahoma", Font.BOLD, 14));
		
		btnAnotherAmount = new JButton("Another amount");
		btnAnotherAmount.setFont(new Font("Tahoma", Font.BOLD, 14));
		
		buttonCancel = new JButton("Cancel");
		buttonCancel.setFont(new Font("Tahoma", Font.BOLD, 14));
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(130)
					.addComponent(lblSelect)
					.addContainerGap(134, Short.MAX_VALUE))
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(38)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
						.addComponent(btnBack, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(btnSum10, GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)
						.addComponent(btnSum50, GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
					.addPreferredGap(ComponentPlacement.RELATED, 88, Short.MAX_VALUE)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(btnSum100, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnSum200, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE)
						.addComponent(buttonCancel, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(62, Short.MAX_VALUE))
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(157)
					.addComponent(btnAnotherAmount, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(187, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(41)
					.addComponent(lblSelect)
					.addGap(38)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(btnSum10, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnSum100, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE))
					.addGap(37)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(btnSum200, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnSum50, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE))
					.addGap(38)
					.addComponent(btnAnotherAmount, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
					.addGap(41)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(btnBack, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
						.addComponent(buttonCancel, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(89, Short.MAX_VALUE))
		);
		setLayout(groupLayout);
	}

}
